/* REPLICATION CODE FOR "TWO TERMS OF ENDEARMENT?"
JOURNAL: POLITICAL SCIENCE RESEARCH & METHODS
AUTHOR:  JOHN V. KANE (jvk221@nyu.ed)
*/

cls // clear screen
ssc install schemepack, replace // color schemes
net install grc1leg, from( http://www.stata.com/users/vwiggins/) replace // combine graphs and use 1 legend
graph set window fontface "Garamond" // set font


**# OBSERVATIONAL ANALYSES

*TABLE 1
use "Election data_Table1.dta", clear

list Year SittingParty1Term SittingParty2orMoreTerms if Year!=.

*Difference in proportion of wins between 1- and 2-term candidates
prtest after1term==after2terms // 44 percentage points

*Difference in 2-party vote shares between 1- and 2-term candidates
ttest SittingParty1Term==SittingParty2orMoreTerms, unpaired

*Difference in 2-party vote share of 1-term candidate compared to expected mean (50%)
ttest SittingParty1Term==.50

*Difference in 2-party vote share of 2-term candidate compared to expected mean (50%)
ttest SittingParty2orMoreTerms==.50


*FIGURE 1
use "Election data_PostCivilWar.dta", clear

*Left panel
mean IncVoteShare_1T // average two-party vote share of 1-term incumbent-party candidates since 1868
est store mod_1t

mean IncVoteShare_2T // average two-party vote share of 2-term incumbent-party candidates since 1868
est store mod_2t

mean IncVoteShare_3Tplus // average two-party vote share of 3+ term incumbent-party candidates since 1868
est store mod_3tplus

coefplot (mod_1t, label(One Term)) (mod_2t, label(Two Terms)) ///
(mod_3tplus, label(Three or More Terms)), ///
recast(bar) barwidth(.4) color(%70) bfintensity(100)  ///
coeflabels(IncVoteShare_1T=" " IncVoteShare_2T=" " IncVoteShare_3Tplus=" ") ///
levels(95 90) citop ///
xline(.5) ///
xtitle("Average Two-Party Vote Share") ///
xlab(.44(.02).66, glcolor(gs15) glpattern(solid)) ///
grid(noticks glpattern(solid) glcolor(gs15)) ///
ylab(, noticks) ///
saving(g1, replace)

ttest IncVoteShare_1T==.50 // p=.01

*Right panel
mean IncVoteShare_1T,over(post1952) // avg. tpvs of 1-term incumbent-party candidates pre/post 1952
est store mod_1tover

mean IncVoteShare_2T,over(post1952) // avg. tpvs of 2-term incumbent-party candidates pre/post 1952
est store mod_2tover

mean IncVoteShare_3Tplus,over(post1952) // avg. tpvs of 3+ term incumbent-party candidates pre/post 1952
est store mod_3tplusover

coefplot (mod_1tover, label(One Term)) (mod_2tover, label(Two Terms)) ///
(mod_3tplusover, label(Three or More Terms)), ///
recast(bar) barwidth(.3) color(%70) bfintensity(100) ///
levels(95 90) citop ///
coeflabels(c.IncVoteShare_1T@0.post1952="Pre-1952" c.IncVoteShare_1T@1.post1952="Post-1952" ///
c.IncVoteShare_2T@0.post1952="Pre-1952" c.IncVoteShare_2T@1.post1952="Post-1952" ///
c.IncVoteShare_3Tplus@0.post1952="Pre-1952" c.IncVoteShare_3Tplus@1.post1952="Post-1952") ///
xline(.5) ///
xtitle("Average Two-Party Vote Share") ///
xlab(.44(.02).66, glcolor(gs15) glpattern(solid)) ///
legend(pos(6) col(3) size(small) colgap(vsmall) keygap(tiny)) ///
grid(glpattern(solid) glcolor(gs15)) ///
ylab(, labsize(small)) ///
saving(g2, replace)

*Combine graphs
grc1leg "g1.gph" "g2.gph" , ///
legendfrom(g2.gph) ///
col(3) ///
iscale(.8) scheme(white_tableau) ///
xsize(6.5) ysize(5.5) ///
graphregion(margin(small)) ///
imargin(small) ///
saving(g12combined, replace) //


**#EXPERIMENT ANALYSES
use "Lucid data.dta", clear

**FIGURE 2
*Top
graph hbar, /// basic horizontal bar graph command (can make vertical by removing "h")
over(inc_PreTreat1T) /// the groups *within* each bar (values seen within bars)
over(D0I1R2) /// the groups *across* bars (values seen on x-axis)
stack asyvars /// commands needed for stacking bars
scheme(white_jet) /// set scheme (white_jet was original)
percentage blabel(bar, pos(center) format(%3.0f) size(medium) color(white)) /// add percentages
bar(1, fintensity(100) fcolor(%80)) ///
bar(2, fintensity(100) fcolor(%80)) ///
bar(3, fintensity(100) fcolor(%80)) ///
bar(4, fintensity(100) fcolor(%80)) ///
bar(5, fintensity(100) fcolor(%80)) ///
bar(6, fintensity(100) fcolor(%80)) ///
ytitle("") /// title y-axis (since it's hbar, y-axis is on bottom)
legend(off) /// specifies size of legend text, rows, and span graph
ylab(, glpattern(solid) glcolor(gs14)) ///
xsize(6.5) ysize(4.5) /// graph dimensions
title("{bf: Presidents Should Have 2 Terms}", box fcolor(gs14) span) ///
saving(stackedgraph_1t, replace) //

*Bottom
graph hbar, /// basic horizontal bar graph command (can make vertical by removing "h")
over(inc_PreTreat_2T) /// the groups *within* each bar (values seen within bars)
over(D0I1R2) /// the groups *across* bars (values seen on x-axis)
stack asyvars /// commands needed for stacking bars
scheme(white_jet) /// set scheme
percentage blabel(bar, pos(center) format(%3.0f) size(medium) color(white)) /// add percentages
bar(1, fintensity(100) fcolor(%80)) ///
bar(2, fintensity(100) fcolor(%80)) ///
bar(3, fintensity(100) fcolor(%80)) ///
bar(4, fintensity(100) fcolor(%80)) ///
bar(5, fintensity(100) fcolor(%80)) ///
bar(6, fintensity(100) fcolor(%80)) ///
ytitle("Percentage of Sample") /// title y-axis (since it's hbar, y-axis is on bottom)
ylab(, glpattern(solid) glcolor(gs14)) ///
xsize(6.5) ysize(4.5) /// graph dimensions
title("{bf: Other Party Should Hold Presidency After 2 Terms}", box fcolor(gs14) span) ///
legend(ring(1) col(1) pos(3) title("{bf: Response Options}", size(medsmall) box margin(vsmall) fcolor(gs14))) ///
saving(stackedgraph_2t, replace) //

*Combine graphs
grc1leg stackedgraph_1t.gph stackedgraph_2t.gph, ///
scheme(white_jet) ///
ycommon xcommon ///
xsize(7.5) ysize(4.5) ///
legendfrom(stackedgraph_2t.gph) ///
pos(3) col(1) ring(1) ///
play("hbar_combined_blue_fixes.grec") /// these fixes change the text color for the light bar & graph dimensions
graphregion(color(white) margin(tiny)) //


**FIGURE 3 
*Left Panel

*Voting for Democrat
logit VoteDem i.Inc0C1T2T if Inc0C1T2T<=1
margins, at(Inc0C1T2T=(0 1)) level(83) saving(incGraphD, replace) // 
* di .4947839-.4294205 = .0653634 change in probability

*Voting for Republican
logit VoteRep i.Inc0C1T2T if Inc0C1T2T<=1  //
margins, at(Inc0C1T2T=(0 1)) level(83) saving(incGraphR, replace) // 
*di .4365559 -.3907875=.0457684

*Weighted average (combining across voting for the Democrat and voting for the Republican)
di (((.4947839-.4294205)*1344)+((.4365559-.3907875)*1335)) / (1344+1335) // .05559881, 5.56 percentage-points

combomarginsplot incGraphD incGraphR, scheme(white_jet) ///
labels("Democratic Candidate" "Republican Candidate") ///
ytitle("{bf:Pr(Vote for the Candidate)}", size(medsmall)) ///
xsize(6.5) ysize(4.5) ///
file1opts(lcolor(midblue%90) lwidth(medthick) msize(vlarge) mcolor(midblue%90) mlcolor(cyan)) ///
file2opts(lcolor("252 0 0"%90) lwidth(medthick) msize(large) msymbol(triangle) mcolor("252 0 0"%90) mlcolor(orange)) ///
fileci1opts(lwidth(medthick) lcolor(midblue%60)) ///
fileci2opts(lwidth(medthick) lcolor("252 0 0%60")) ///
offset(.02) ///
graphregion(margin(medsmall)) ///
xlab(0 `""Pure" "Control""' 1 `""1-Term" "Incumbent""', glpattern(solid) glcolor(gs14)) ///
ylab(, glpattern(solid) glcolor(gs14)) ///
plotregion(margin(large)) ///
legend (ring(0) pos(11) col(1)) title("") xtitle("") saving(combomargins_incumbentEffect.gph, replace)

*Right Panel

logit VoteIncumbent i.Inc1T2T
margins, at(Inc1T2T=(0 1)) level(83)
marginsplot, ///
scheme(white_jet) ///
ytitle("") /// leave blank b/c it will be in the combined graph
xsize(6.5) ysize(4.5) ///
plotregion(margin(large)) ///
graphregion(margin(medsmall)) ///
plotopts(lcolor(gs6%80) lwidth(thick) msize(vlarge) mcolor(black) mlcolor(white)) ///
ciopts(lcolor(gs6%75) lwidth(medthick)) ///
title("") ///
xtitle("") ///
level(83) ///
xlab(0 `""1-Term" "Incumbent""' 1 `""2-Term" "Candidate""', glpattern(solid) glcolor(gs14)) ///
ylab(, glpattern(solid) glcolor(gs14)) ///
saving(1Tv2TincumbentEffect.gph, replace)

*Combine panels
graph combine "combomargins_incumbentEffect.gph" "1Tv2TincumbentEffect.gph", ///
scheme(white_jet) graphregion(margin(tiny)) col(2) ///
xsize(6.5) ysize(4.5) ///
ycommon xcommon


**FIGURE 4

*Democratic candidate estimates
logit VoteDem i.Inc0C1T2T
margins, at(Inc0C1T2T=(0 1 2)) level(83) saving(incGraphD2, replace) // 

*Republican candidate estimates
logit VoteRep i.Inc0C1T2T
margins, at(Inc0C1T2T=(0 1 2)) level(83) saving(incGraphR2, replace) // 

*Figure
combomarginsplot incGraphD2 incGraphR2, scheme(white_jet) ///
labels("Democratic Candidate" "Republican Candidate") ///
ytitle("{bf:Pr(Vote for the Candidate)}", size(medsmall)) ///
xsize(6.5) ysize(4.5) ///
file1opts(lcolor(midblue%90) lwidth(medthick) msize(vlarge) mcolor(midblue%90) mlcolor(cyan)) ///
file2opts(lcolor("252 0 0"%90) lwidth(medthick) msize(vlarge) msymbol(triangle) mcolor("252 0 0"%90) mlcolor(orange)) ///
fileci1opts(lwidth(medthick) lcolor(midblue%60)) ///
fileci2opts(lwidth(medthick) lcolor("252 0 0%60")) ///
offset(.02) ///
graphregion(margin(small)) ///
xlab(0 `""Pure" "Control""' 1 `""One-Term" "Incumbent-Party""' 2 `""Two-Term" "Incumbent-Party""', ///
glpattern(solid) glcolor(gs14)) ///
ylab(, glpattern(solid) glcolor(gs14)) ///
plotregion(margin(large)) ///
legend (ring(1) pos(3) col(1)) title("") xtitle("") saving(combomargins_incumbentEffect2.gph, replace)


**FIGURE 5
use "VSG Panel Data.dta", replace

*Left panel estimates
logit vote1termIncumbent b1.D0I1R2 c.PolInt01 Female i.raceclean_baseline ///
age_baseline01 famincclean_2011_01 educclean_baseline_01 
margins, dydx(*) post
estimates store incumbenteffects_1T 

*Right panel estimates
logit vote2termIncumbent b1.D0I1R2 c.PolInt01 Female i.raceclean_baseline ///
age_baseline01 famincclean_2011_01 educclean_baseline_01
margins, dydx(*) post
estimates store incumbenteffects_2T

*Figure
coefplot incumbenteffects_1T, bylabel("{bf:Vote For 1-Term Incumbents}") || ///
incumbenteffects_2T, bylabel("{bf: Vote Against 2-Term Incumbents}") ///
drop(_cons)  ///
baselevels ///
xtitle("                                       Effect on Probability of Voting Based Upon Incumbency Status", size(small)) ///
xsize(6.5) ysize(4.5)  ///
levels(95 90) ciopts(lwidth(medium medthick) recast(rspike rcap)) ///
graphregion(margin(vsmall)) ///
fcolor(%45) fintensity(100) lcolor(black) ///
msize(medlarge) mlcolor(black) mlwidth(medium) ///
xlab(, glpattern(solid) glcolor(gs14)) ///
grid(glpattern(solid) glcolor(gs14)) ///
xline(0, lwidth(medium) lcolor(black)) ///
order(0.D0I1R2 1.D0I1R2 2.D0I1R2  ///
PolInt01 Female 1.raceclean_baseline ///
2.raceclean_baseline 3.raceclean_baseline 4.raceclean_baseline ///
age_baseline01 famincclean_2011_01 educclean_baseline_01) ///
headings(0.D0I1R2= "{bf: Political Variables}" ///
Female= "{bf: Demographic Variables}", gap(0)) ///
coeflabels(0.D0I1R2= "Democrat" 1.D0I1R2= "Independent" 2.D0I1R2= "Republican" ///
Female= "Female" /// label variables in the graph the following way
PolInt01= "Interest in Politics" ///
age_baseline01= "Age" /// 
famincclean_2011_01= "Household Income" educclean_baseline_01= "Education Level") //



****************************************
*SUPPLEMENTAL ANALYSES
****************************************

*SUPPLEMENTAL APPENDIX A
use "Lucid data.dta", clear

*Table A1
tab gender_clean // gender 
sum age_clean, det // age
tab race // racial identification
tab hispanic_clean // hispanic identification
tab D0I1R2 // party identification
tab LibModCons // ideological self-placement
tab region // geographic region


*SUPPLEMENTAL APPENDIX B

*Figure B1
logit inc_PreTreat1T_binary b1.D0I1R2 gender i.race_clean age_clean_01 hhi_clean_01 edu_clean_01
margins, dydx(*)
estimates store mod_1t
logit inc_PreTreat2T_binary b1.D0I1R2 gender i.race_clean age_clean_01 hhi_clean_01 edu_clean_01
margins, dydx(*)
estimates store mod_2t

coefplot mod_1t, bylabel("{bf: Presidents Should Get 2 Terms}") || ///
mod_2t, bylabel("{bf: Change Parties After 2 Terms}") ///
drop(_cons)  ///
baselevels ///
xtitle("                                       Effect on Probability of Endorsing Norm", size(small)) ///
xsize(6.5) ysize(4.5)  ///
levels(95 90) ciopts(lwidth(medium medthick) recast(rspike rcap)) ///
graphregion(margin(vsmall)) ///
fcolor(%45) fintensity(100) lcolor(black) ///
msize(medlarge) mlcolor(black) mlwidth(medium) ///
xline(0, lwidth(medium) lcolor(black)) ///
grid(glpattern(solid) glcolor(gs14)) ///
xlab(, glpattern(solid) glcolor(gs14)) ///
order(0.D0I1R2 1.D0I1R2 2.D0I1R2  ///
gender 1.race_clean ///
2.race_clean  3.race_clean  4.race_clean  5.race_clean  ///
age_clean_01 hhi_clean_01 edu_clean_01) ///
headings(0.D0I1R2= "{bf: Political Variables}" ///
gender= "{bf: Demographic Variables}", gap(0)) ///
coeflabels(0.D0I1R2= "Democrat" 1.D0I1R2= "Independent" 2.D0I1R2= "Republican" ///
gender= "Female" /// 
age_clean_01= "Age" /// 
hhi_clean_01= "Household Income" edu_clean_01= "Education Level") //


*SUPPLEMENTAL APPENDIX C

*Table C1
*Democratic candidate estimates
logit VoteDem i.Inc0C1T2T

*Republican candidate estimates
logit VoteRep i.Inc0C1T2T

*2-Term vs. 1-Term estimates
logit VoteIncumbent i.Inc0C1T2T

*Figure C1
logit VoteIncumbent i.Inc0C1T2T##i.askedpretreatQs if Inc0C1T2T>=1
margins, dydx(i.Inc0C1T2T) at(askedpretreatQs=(0 1))
marginsplot, scheme(stcolor) recastci(rarea) yline(0, lcolor(red)) ciopts(fcolor(%50)) ///
plotopts(msize(medlarge) mlcolor(black) lwidth(medium)) ///
xtitle(Respondent Asked About Norm Pretreatment?) ///
ytitle("{bf: Effect on Change in pr(Vote Incumbent)}") ///
xlab(, glpattern(solid) glcolor(gs14)) ///
ylab(, glpattern(solid) glcolor(gs14)) ///
graphregion(margin(medium)) ///
xsize(6.5) ysize(4.5) ///
title("")


*SUPPLEMENTAL APPENDIX D

*Figure D1
logit VoteDem i.Inc0C1T2T##i.D0I1R2
margins, dydx(i.Inc0C1T2T) at(D0I1R2=(0 1 2)) level(95) 
marginsplot, yline(0) xtitle("") title("") ///
ytitle(Effect of Treatment on pr(Vote for Democratic Candidate)) ///
xsize(6.5) ysize(4.5) xlab(, labsize(small)) graphregion(margin(medlarge)) ///
plot( , label("1-Term vs. Control" "2-Term vs. Control")) 

*Figure D2
logit VoteRep i.Inc0C1T2T##i.D0I1R2 
margins, dydx(i.Inc0C1T2T) at(D0I1R2=(0 1 2)) level(95)
marginsplot, yline(0) xtitle("") title("") ///
ytitle(Effect of Treatment on pr(Vote for Republican Candidate)) ///
xsize(6.5) ysize(4.5) ylab(-.1(.05).2) xlab(, labsize(small)) graphregion(margin(medlarge)) ///
plot( , label("1-Term vs. Control" "2-Term vs. Control")) 

*Figure D3
logit VoteIncumbent i.Inc0C1T2T##i.D0I1R2 if Inc0C1T2T>=1  
margins, dydx(i.Inc0C1T2T) at(D0I1R2=(0 1 2)) level(95)
marginsplot, yline(0) xtitle("") title("") ///
xsize(6.5) ysize(4.5) xlab(, labsize(small)) graphregion(margin(medlarge))

*Figure D4
*Dem Candidate:  1T vs. Control
logit VoteDem i.Inc0C1T2T##c.inc_PreTreat1T_01 if Inc0C1T2T<=1  // null interactions might be partly due to partisans
margins, dydx(Inc0C1T2T) at(inc_PreTreat1T_01=(0(.2)1)) saving(normsgraph1D, replace)
marginsplot,  yline(0) title("{bf: 1T vs. Control}", pos(12) span box) xtitle("Give Incumbent Party Two Terms Norm")  ///
ytitle("Effect on pr(Vote for Democratic Incumbent)") ///
saving(normsgraph1D.gph, replace)

*Republican Candidate: 1T vs. Control
logit VoteRep i.Inc0C1T2T##c.inc_PreTreat1T_01 if Inc0C1T2T<=1  // null interactions might be partly due to partisans
margins, dydx(Inc0C1T2T) at(inc_PreTreat1T_01=(0(.2)1)) saving(normsgraph1R, replace)
marginsplot,  yline(0) title("{bf: 1T vs. Control}", pos(12) span box) xtitle("Give Incumbent Party Two Terms Norm")  ///
ytitle("Effect on pr(Vote for Republican Incumbent)") ///
plotopts(lcolor(red) mcolor(red)) ciopts(color(red)) ///
saving(normsgraph1R.gph, replace)

*Combine graphs
combomarginsplot normsgraph1D normsgraph1R,  ///
labels("Democratic Candidate" "Republican Candidate") ///
ytitle("{bf:Conditional Effect of 1-Term on pr(Vote for the Candidate)}", size(small)) ///
xtitle("{bf:Norm: Incumbent Party Should Get Two Terms}", size(small)) ///
xsize(6.5) ysize(4.5) ///
file1opts(lcolor(%90) lwidth(medium) msize(large) msymbol(circle) mcolor(%90)) ///
file2opts(lcolor("252 0 0"%90) lwidth(medium) msize(large) msymbol(triangle) mcolor("252 0 0"%90) mlcolor(orange)) ///
fileci1opts(lwidth(medium) lcolor()) ///
fileci2opts(lwidth(medium) lcolor("252 0 0%60")) ///
graphregion(margin(medium)) ///
xlab(0(.2)1, glpattern(solid) glcolor(gs14)) ///
ylab(, glpattern(solid) glcolor(gs14)) ///
yline(0) ///
plotregion(margin(large)) ///
legend (ring(1) pos(3) col(1)) title("") saving(combomargins_norminteraction1Tgraphs.gph, replace)

*Figure D5
*Dem candidate:  2T vs. Control
logit VoteDem i.Inc0C1T2T##c.inc_PreTreat_2T_01 if Inc0C1T2T!=1  // null interactions might be partly due to partisans
margins, dydx(Inc0C1T2T) at(inc_PreTreat_2T_01=(0(.2)1)) saving(normsgraph2D, replace)
marginsplot,  yline(0) title("{bf: 2T vs. Control}", pos(12) span box) xtitle("Give Incumbent Party Two Terms Norm")  ///
ytitle("Effect on pr(Vote for Democratic Incumbent)") ///
saving(normsgraph2D.gph, replace)

*Rep candidate:  2T vs. Control 
logit VoteRep i.Inc0C1T2T##c.inc_PreTreat_2T_01 if Inc0C1T2T!=1  // null interactions might be partly due to partisans
margins, dydx(Inc0C1T2T) at(inc_PreTreat_2T_01=(0(.2)1)) saving(normsgraph2R, replace)
marginsplot,  yline(0) title("{bf: 2T vs. Control}", pos(12) span box) xtitle("Give Incumbent Party Two Terms Norm")  ///
ytitle("Effect on pr(Vote for Republican Incumbent)") ///
plotopts(lcolor(red) mcolor(red)) ciopts(color(red)) ///
saving(normsgraph2R.gph, replace)

*Combined graphs
combomarginsplot normsgraph2D normsgraph2R,  ///
labels("Democratic Candidate" "Republican Candidate") ///
ytitle("{bf:Conditional Effect of 2-Term on pr(Vote for the Candidate)}", size(small)) ///
xtitle("{bf:Norm: Change Parties After Two Terms}", size(small)) ///
xsize(6.5) ysize(4.5) ///
file1opts(lcolor(%90) lwidth(medium) msize(large) msymbol(circle) mcolor(%90)) ///
file2opts(lcolor("252 0 0"%90) lwidth(medium) msize(large) msymbol(triangle) mcolor("252 0 0"%90) mlcolor(orange)) ///
fileci1opts(lwidth(medium) lcolor()) ///
fileci2opts(lwidth(medium) lcolor("252 0 0%60")) ///
graphregion(margin(medium)) ///
xlab(0(.2)1, glpattern(solid) glcolor(gs14)) ///
ylab(, glpattern(solid) glcolor(gs14)) ///
yline(0) ///
plotregion(margin(large)) ///
legend (ring(1) pos(3) col(1)) title("") saving(combomargins_norminteraction2Tgraphs.gph, replace)

*Figure D6
logit VoteIncumbent i.Inc1T2T##c.inc_PreTreat_2T_01
margins, dydx(Inc1T2T) at(inc_PreTreat_2T_01=(0(.2)1))
marginsplot,  yline(0)  title("") xtitle("{bf: Norm:  Change Parties After 2 Terms}")  ///
ytitle("{bf: Conditional Effect of 2-Term on pr(Vote for Incumbent Candidate)}", size(small)) ///
plotopts(lcolor(black) lwidth(medthick) mcolor(black) msymbol(circle_hollow) msize(medlarge)) ///
ciopts(color(black)) ///
xlab(, glpattern(solid) glcolor(gs14)) ///
ylab(, glpattern(solid) glcolor(gs14)) ///
xsize(6.5) ysize(4.5) graphregion(margin(vsmall)) ///
saving(normsgraph2T.gph, replace)


*SUPPLEMENTAL APPENDIX E

*Table E1
tab inc_FMC incumbencytreatment, nofreq col chi2 V 


*SUPPLEMENTAL APPENDIX F

*Figure F1
*Left panel
logit VoteDem i.Inc0C1T2T##c.mvcscale_01 if Inc0C1T2T<=1 // 1 term effect more positive (sig)
margins, dydx(i.Inc0C1T2T) at(mvcscale_01=(0(.5)1))
marginsplot,  yline(0) title("{bf: 1T vs. Control}", pos(12) span box) xtitle("Mock Vignette Check Performance")  ///
ytitle("Effect on pr(Vote for Democratic Candidate)") ///
saving(MVCgraph1.gph, replace)

*Center panel
logit VoteRep i.Inc0C1T2T##c.mvcscale_01 if Inc0C1T2T<=1 // 1 term effect more positive (marg sig 1T)
margins, dydx(i.Inc0C1T2T) at(mvcscale_01=(0(.5)1))
marginsplot, yline(0) title("{bf: 1T vs. Control}", pos(12) span box) xtitle("Mock Vignette Check Performance") ///
ytitle("Effect on pr(Vote for Republican Candidate)") ///
plotopts(lcolor(red) mcolor(red)) ciopts(color(red)) ///
saving(MVCgraph2.gph, replace)

*Right panel
logit VoteIncumbent i.Inc0C1T2T##c.mvcscale_01 if Inc0C1T2T>=1 // more negative (correct)
margins, dydx(i.Inc0C1T2T) at(mvcscale_01=(0(.5)1))
marginsplot,  yline(0) title("{bf: 2T vs. 1T}", pos(12) span box) xtitle("Mock Vignette Check Performance") ///
ytitle("Effect on pr(Vote for Incumbent-Party Candidate)") ///
plotopts(lcolor(black) mcolor(black)) ciopts(color(black)) ///
saving(MVCgraph3.gph, replace)

*Combine panels
graph combine "MVCgraph1.gph" "MVCgraph2.gph" "MVCgraph3.gph", col(3) ///
xsize(6.5) ysize(4.5) graphregion(margin(vsmall)) 

*Figure F2
logit VoteDem i.Inc0C1T2T##c.mvcscale_01 if Inc0C1T2T!=1
margins, dydx(i.Inc0C1T2T) at(mvcscale_01=(0(.5)1)) saving(incMVCGraphD, replace) 

logit VoteRep i.Inc0C1T2T##c.mvcscale_01 if Inc0C1T2T!=1
margins, dydx(i.Inc0C1T2T) at(mvcscale_01=(0(.5)1)) saving(incMVCGraphR, replace)

*Combine plots
combomarginsplot incMVCGraphD incMVCGraphR, scheme(white_jet) ///
labels("Democratic Candidate" "Republican Candidate") ///
ytitle("{bf:Effect of 2T vs. Control on pr(Vote for the Candidate)}") ///
xsize(6.5) ysize(4.5) ///
file1opts(lcolor(midblue%90) lwidth(medthick) msize(vlarge) mcolor(midblue%90) mlcolor(cyan)) ///
file2opts(lcolor("252 0 0"%90) lwidth(medthick) msize(vlarge) mcolor("252 0 0"%90) mlcolor(orange)) ///
fileci1opts(lwidth(medthick) lcolor(midblue%60)) ///
fileci2opts(lwidth(medthick) lcolor("252 0 0%60")) ///
graphregion(margin(medium)) ///
xlab(, glpattern(solid) glcolor(gs14)) ///
ylab(-.2(.05).2, glpattern(solid) glcolor(gs14)) ///
yline(0, lcolor(black)) ///
plotregion(margin(large)) ///
legend (ring(1) pos(3) col(1)) ///
title("") xtitle("MVC Performance") //


*SUPPLEMENTAL APPENDIX G
use "VSG Panel Data.dta", clear

*Table G1
*Vote for 1-term incumbents
logit vote1termIncumbent b1.D0I1R2 c.PolInt01 Female i.raceclean_baseline ///
age_baseline01 famincclean_2011_01 educclean_baseline_01 

*Vote against 2-term incumbents 
logit vote2termIncumbent b1.D0I1R2 c.PolInt01 Female i.raceclean_baseline ///
age_baseline01 famincclean_2011_01 educclean_baseline_01


*SUPPLEMENTAL APPENDIX I
use "Election data_PostCivilWar.dta", clear

*Figure I1
preserve // 
rename (Dem_2pvs Rep_2pvs) var=
reshape long var, i(Election) j(which) string
collapse var, by(which Election)
separate var, by(which) veryshortlabel

tw dot var? Election, ms(triangle triangle) msize(medium medium) mcolor(midblue red)  ///
horizontal ///
ylab(1868(4)2020, labsize(vsmall) angle(horiz)) ///
xlab(.3(.05).7, labsize(small)) ///
yscale(reverse) ///
ytitle("") ///
xline(.50, lcolor(gs6)) ///
graphregion(margin(vsmall)) ///
xsize(6.5) ysize(5.5) ///
xtitle(Two-Party Vote Share, size(vsmall)) ///
legend(pos(1) ring(0) size(vsmall)) ///
legend(order(1 "Democrats" 2 "Republicans") region(margin(vsmall) lcolor(black) fcolor(gs14)))

restore

/* Create a variable for losing vote share between initial election and 1st reelection attempt
gen IncPartyLostVotesFirstTerm=0 if inlist(Election, 1888, 1900, 1916, 1924, 1936, 1956, 1964, 1972, 1984, 1996, 2004)
replace IncPartyLostVotesFirstTerm=1 if inlist(Election, 1892, 1896, 1980, 2012, 2020)
label define IncPartyLostVotesFirstTerm 0 "Did Not Lose 2PVS" 1 "Lost 2PVS"
label values IncPartyLostVotesFirstTerm IncPartyLostVotesFirstTerm
*/

*Analysis of vote share lost between initial election and first re-election
tab IncPartyLostVotesFirstTerm

*******************************
*END
*******************************
